package me.yannchou.weicoer.ui.main.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import me.yannchou.weicoer.R;

/**
 * @author zhouyanbin
 * @time 2014/11/25.21:32
 */
public class MainFragment extends Fragment {

    private View rootView;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        if (rootView==null){
            rootView = inflater.inflate(R.layout.main_fragment,container,false);
        }else {
            ViewGroup parent = (ViewGroup) rootView.getParent();
            if (parent!=null){
                parent.removeView(rootView);
            }
        }
        return rootView;
    }



}
